home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Dialing Addresses / Src / Address.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  5.6 KB  |  162 lines

  1. /*******************************************************************
  2.  Copyright © 1995 - 1998, 3Com Corporation or its subsidiaries ("3Com").  
  3.  All rights reserved.
  4.    
  5.  This software may be copied and used solely for developing products for 
  6.  the Palm Computing platform and for archival and backup purposes.  Except 
  7.  for the foregoing, no part of this software may be reproduced or transmitted 
  8.  in any form or by any means or used to make any derivative work (such as 
  9.  translation, transformation or adaptation) without express written consent 
  10.  from 3Com.
  11.  
  12.  3Com reserves the right to revise this software and to make changes in content 
  13.  from time to time without obligation on the part of 3Com to provide notification 
  14.  of such revision or changes.  
  15.  3COM MAKES NO REPRESENTATIONS OR WARRANTIES THAT THE SOFTWARE IS FREE OF ERRORS 
  16.  OR THAT THE SOFTWARE IS SUITABLE FOR YOUR USE.  THE SOFTWARE IS PROVIDED ON AN 
  17.  "AS IS" BASIS.  3COM MAKES NO WARRANTIES, TERMS OR CONDITIONS, EXPRESS OR IMPLIED, 
  18.  EITHER IN FACT OR BY OPERATION OF LAW, STATUTORY OR OTHERWISE, INCLUDING WARRANTIES, 
  19.  TERMS, OR CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND 
  20.  SATISFACTORY QUALITY.
  21.  
  22.  TO THE FULL EXTENT ALLOWED BY LAW, 3COM ALSO EXCLUDES FOR ITSELF AND ITS SUPPLIERS 
  23.  ANY LIABILITY, WHETHER BASED IN CONTRACT OR TORT (INCLUDING NEGLIGENCE), FOR 
  24.  DIRECT, INCIDENTAL, CONSEQUENTIAL, INDIRECT, SPECIAL, OR PUNITIVE DAMAGES OF 
  25.  ANY KIND, OR FOR LOSS OF REVENUE OR PROFITS, LOSS OF BUSINESS, LOSS OF INFORMATION 
  26.  OR DATA, OR OTHER FINANCIAL LOSS ARISING OUT OF OR IN CONNECTION WITH THIS SOFTWARE, 
  27.  EVEN IF 3COM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  28.  
  29.  3Com, HotSync, Palm Computing, and Graffiti are registered trademarks, and 
  30.  Palm III and Palm OS are trademarks of 3Com Corporation or its subsidiaries.
  31.  
  32.  IF THIS SOFTWARE IS PROVIDED ON A COMPACT DISK, THE OTHER SOFTWARE AND 
  33.  DOCUMENTATION ON THE COMPACT DISK ARE SUBJECT TO THE LICENSE AGREEMENT 
  34.  ACCOMPANYING THE COMPACT DISK.
  35.  
  36.  *-------------------------------------------------------------------
  37.  * FileName:
  38.  *        Address.h
  39.  *
  40.  * Description:
  41.  *        Header for the Address Book.
  42.  *
  43.  * History:
  44.  *       4/24/97  roger - Created
  45.  *
  46.  *******************************************************************/
  47.  
  48.  
  49. #include <IMCUtils.h>
  50. #include <ExgMgr.h>
  51.  
  52. #include "AddressDB.h"
  53.  
  54.  
  55.  
  56. /***********************************************************************
  57.  *
  58.  *   Internal Constants
  59.  *
  60.  ***********************************************************************/
  61.  
  62. #define addrVersionNum                    0x03
  63. #define addrPrefVersionNum                        0x03
  64. #define addrPrefID                        0x00
  65. #define addrDBName                        "AddressDB"
  66. #define addrDBType                        'DATA'
  67.  
  68. #define shortenedFieldString              "..."
  69. #define shortenedFieldLength              3
  70. #define fieldSeparatorString              ", "
  71. #define fieldSeparatorLength              2
  72. #define spaceBetweenNamesAndPhoneNumbers  6
  73.  
  74. // Address lookup table columns
  75. #define field1Column                      0
  76. #define field2Column                      1
  77.  
  78.  
  79.  
  80. /***********************************************************************
  81.  *
  82.  *   Internal Structures
  83.  *
  84.  ***********************************************************************/
  85.  
  86. // The Lookup command is called while another app is running.  Because of
  87. // of this the other app and not the Address Book has global variables.
  88. // All the variables the lookup command needs as globals are therefore
  89. // kept in this structure.
  90. typedef struct 
  91.    {
  92.    AddrLookupParamsPtr params;
  93.    FormPtr frm;
  94.    DmOpenRef dbP;
  95.    Boolean hideSecretRecords;
  96.    Word currentRecord;
  97.    Word currentPhone;
  98.    Word topVisibleRecord;
  99.    Word topVisibleRecordPhone;
  100.    Boolean sortByCompany;
  101.    Boolean ignoreEmptyLookupField;
  102.    AddressFields lookupFieldMap[addrLookupNoField];
  103.    Char phoneLabelLetters[numPhoneLabels];
  104.    } LookupVariablesType;
  105.  
  106. typedef LookupVariablesType * LookupVariablesPtr;
  107.  
  108.  
  109.  
  110.  
  111.  
  112. /************************************************************
  113.  * Global Variables
  114.  *************************************************************/
  115.  
  116. extern Boolean         SortByCompany;
  117.  
  118.  
  119. /************************************************************
  120.  * Function Prototypes
  121.  *************************************************************/
  122. #ifdef __cplusplus
  123. extern "C" {
  124. #endif
  125.  
  126.  
  127. // From Address.c
  128. extern Boolean DetermineRecordName (AddrDBRecordPtr recordP, 
  129.    UInt *shortenedFieldWidth, UInt *fieldSeparatorWidth, Boolean sortByCompany,
  130.    CharPtr *name1, Int *name1Length, Int *name1Width, 
  131.    CharPtr *name2, Int *name2Length, Int *name2Width, 
  132.    CharPtr *unnamedRecordStringPtr, UInt nameExtent);
  133.  
  134. extern void DrawRecordName (
  135.    CharPtr name1, Int name1Length, Int name1Width, 
  136.    CharPtr name2, Int name2Length, Int name2Width,
  137.    UInt nameExtent, SWord *x, SWord y, UInt shortenedFieldWidth, 
  138.    UInt fieldSeparatorWidth, Boolean center, Boolean priorityIsName1);
  139.  
  140. extern void InitPhoneLabelLetters(AddrAppInfoPtr appInfoPtr, CharPtr phoneLabelLetters);
  141. extern VoidPtr GetObjectPtr (Word objectID);
  142.  
  143. // From AddressLookup.c
  144. extern void Lookup (AddrLookupParamsType * params);
  145.  
  146.  
  147. // From AddressTransfer.c
  148. extern void AddrSendRecord (DmOpenRef dbP, Int recordNum);
  149. extern void AddrSendCategory (DmOpenRef dbP, Word categoryNum);
  150. extern Err AddrReceiveData(DmOpenRef dbP, ExgSocketPtr obxSocketP);
  151. extern Boolean AddrImportVCard(DmOpenRef dbP, VoidPtr inputStream, GetCharF inputFunc,
  152.     Boolean obeyUniqueIDs, Boolean beginAlreadyRead);
  153. extern void AddrExportVCard(DmOpenRef dbP, Int index, AddrDBRecordType *recordP, 
  154.     const VoidPtr outputStream, const PutStringF outputFunc, Boolean writeUniqueIDs);
  155. extern void AddrRegisterData ();
  156.  
  157.  
  158. #ifdef __cplusplus 
  159. }
  160. #endif
  161.  
  162.